package de.g18.it0a.jlaser.dataio;

import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;

public class TestDataProvider {

    private static TestDataProvider instance;

	private File[] configFileList;


	private TestDataProvider() {
		URL path = TestDataProvider.class.getResource("/resources");
		File directory;
		try {
			directory = new File(path.toURI());
			configFileList = directory.listFiles();
		} catch (Exception e) {
			configFileList = new File[0];
		}
    }

	public static TestDataProvider getInstance() {
	    if (instance == null) {
	        createInstance();
	    }
	    return instance;
	}

	private static synchronized void createInstance() {
	    if (instance == null) {
	        instance = new TestDataProvider();
	    }
	}

	public File[] getConfigFiles() {
		return configFileList.clone();
	}
}
